import Vue from 'vue'
import VueRouter from 'vue-router'
import Dashboard from '../views/Dashboard'
import Webview from '../views/Webview'
import Test from '../views/Test'
import Product from '../components/Product'
import Home from '../views/Home'
import Page1 from '../components/Page1'
import Page2 from '../components/Page2'
import Page3 from '../components/Page3'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard
  },
  {
    path: '/webview',
    name: 'Webview',
    component: Webview
  },
  {
    path: '/test',
    name: 'Test',
    component: Test
  },
  {
    path: '/product',
    name: 'Product',
    component: Product
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
      {
        path: '/Page1',
        name: 'Page1',
        component: Page1

      },
      {
        path: '/Page2',
        name: 'Page2',
        component: Page2

      },
      {
        path: '/Page3',
        name: 'Page3',
        component: Page3

      }

    ]
  }

]

const router = new VueRouter({
routes})

export default router
